/*******************************************************************
 *   > File Name: StateMachine.c
 *   > Author: fly
 *   > Mail: 1358326274@qq.com
 *   > Create Time: 2020年10月16日 星期五 23时02分34秒
 ******************************************************************/

#include <stdio.h>
#include "StateMachine.h"

void action_callback(void *arg){
    StateTransform *statTran = (StateTransform*)arg;
    
    if(statename[statTran->curState] == statename[statTran->nextState]){
        printf("invalid event, state not change.\n");
    }else{
        printf("call back state from %s --> %s.\n",\
                statename[statTran->curState], \
               statename[statTran->nextState] );
    }
}

/*origin*/
StateTransform stateTran_0[] = {
    {sta_origin, evt_fork,          sta_running, action_callback},
    {sta_origin, evt_sched,         sta_origin, NULL},
    {sta_origin, evt_wait,          sta_origin, NULL},
    {sta_origin, evt_wait_unint,    sta_origin, NULL},
    {sta_origin, evt_wake_up,       sta_origin, NULL},
    {sta_origin, evt_wake,          sta_origin, NULL},
};

int main(int argc, char* argv[])
{
    return 0;
}
